Skip to content

fix(testing): strip relative paths (as well as file:// paths) from snapshot test subprocess stderr#7081

Open
dandv wants to merge 1 commit intodenoland:mainfrom
dandv:fix-snapshot-test-check-regex
Open

fix(testing): strip relative paths (as well as file:// paths) from snapshot test subprocess stderr#7081
dandv wants to merge 1 commit intodenoland:mainfrom
dandv:fix-snapshot-test-check-regex

Conversation

@dandv
Copy link
Copy Markdown
Contributor

@dandv dandv commented Apr 2, 2026

Fix #7080.

formatTestError in snapshot_test.ts strips Deno's Check <path> diagnostic lines from subprocess stderr, but the
regex only matched file:// URLs. Deno outputs file:// URLs when the working dir is 3+ levels from the filesystem root, but it outputs relative paths (e.g. ../../tmp/…) when the working directory is fewer than 3 levels from /. That left the line unstripped and caused assertNoError to throw.

This fix broadens the regex from /^Check file:\/\/(.+)\n/gm to /^Check .+\n/gm so it matches any path format Deno emits.

Authored with help from Claude 4.6.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 2, 2026

CLA assistant check
All committers have signed the CLA.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.41%. Comparing base (1cd63ca) to head (83602d8).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7081   +/-   ##
=======================================
  Coverage   94.41%   94.41%           
=======================================
  Files         630      630           
  Lines       50490    50490           
  Branches     8949     8949           
=======================================
+ Hits        47669    47670    +1     
  Misses       2249     2249           
+ Partials      572      571    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dandv dandv force-pushed the fix-snapshot-test-check-regex branch from 34e4aeb to a49aab4 Compare April 2, 2026 05:48
@dandv dandv force-pushed the fix-snapshot-test-check-regex branch from a49aab4 to 83602d8 Compare April 2, 2026 05:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

assertSnapshot tests fail if repo path is less than 3 levels deep

2 participants